Micron Document
🌎 rns.kin.earth git 🌍

Node / dev / reticulum / commits / ddb7a92

Commit ddb7a92c15f2f8dbb4e70941b17b4e09909b4e70


Parents : b381a61
Author : Dionysis Grigoropoulos <dgrig@erethon.com>
Date : 2023-03-01T16:22:51+02:00

hkdf: Remove duplicate check if the salt is None

The second if isn't needed since we initialize the salt with zeroes
earlier. If instead we meant to pass an empty bytes class to the HMAC
implementation, the end result would be the same, since it's gonna get
padded with zeroes in the HMAC code.

Changes

1 files changed, 0 insertions(+), 3 deletions(-)


Diff

diff --git a/RNS/Cryptography/HKDF.py b/RNS/Cryptography/HKDF.py
index 0491ddad..5c964b2a 100644
--- a/RNS/Cryptography/HKDF.py
+++ b/RNS/Cryptography/HKDF.py
@@ -39,9 +39,6 @@ def hkdf(length=None, derive_from=None, salt=None, context=None):
if salt == None or len(salt) == 0:
salt = bytes([0] * hash_len)
- if salt == None:
- salt = b""
-
if context == None:
context = b""

Served by rngit 1.5.0 - Generated in 0.04s